Can we not rely only on statistical modeling?
Can we not rely only on statistical modeling?
| x1 | x2 | x3 | x4 | y1 | y2 | y3 | y4 |
|---|---|---|---|---|---|---|---|
| 10 | 10 | 10 | 8 | 8.04 | 9.14 | 7.46 | 6.58 |
| 8 | 8 | 8 | 8 | 6.95 | 8.14 | 6.77 | 5.76 |
| 13 | 13 | 13 | 8 | 7.58 | 8.74 | 12.74 | 7.71 |
| 9 | 9 | 9 | 8 | 8.81 | 8.77 | 7.11 | 8.84 |
| 11 | 11 | 11 | 8 | 8.33 | 9.26 | 7.81 | 8.47 |
| 14 | 14 | 14 | 8 | 9.96 | 8.10 | 8.84 | 7.04 |
| 6 | 6 | 6 | 8 | 7.24 | 6.13 | 6.08 | 5.25 |
| 4 | 4 | 4 | 19 | 4.26 | 3.10 | 5.39 | 12.50 |
| 12 | 12 | 12 | 8 | 10.84 | 9.13 | 8.15 | 5.56 |
| y1 | y2 | y3 | y4 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Predictors | Est. | Std. Err | p | Est. | Std. Err | p | Est. | Std. Err | p | Est. | Std. Err | p |
| (Intercept) | 3.00 | 1.12 | 0.026 | 3.00 | 1.13 | 0.026 | 3.00 | 1.12 | 0.026 | 3.00 | 1.12 | 0.026 |
| x1 | 0.50 | 0.12 | 0.002 | |||||||||
| x2 | 0.50 | 0.12 | 0.002 | |||||||||
| x3 | 0.50 | 0.12 | 0.002 | |||||||||
| x4 | 0.50 | 0.12 | 0.002 | |||||||||
| Observations | 11 | 11 | 11 | 11 | ||||||||
| R2 / R2 adjusted | 0.667 / 0.629 | 0.666 / 0.629 | 0.666 / 0.629 | 0.667 / 0.630 | ||||||||
This class will focus on two learning objectives:
Developing foundational technical skills that allow us to
dplyr, rtidy)ggplot2)plotly)ggplot2/plotly + shiny)shiny, RMarkdown’s flexdashboard)JavaScript codingThese materials will be delivered via lectures and you will be asked to submit some homework assignments.
There are today MANY software packages and services for data visualization. The software we chose for this class is:
Interactive visualizations for the web can happen in one of two ways, client or server side.
Client side:
Client side:
plotly.js is a JavaScript package that makes interactive plots from within HTML files.plotly that will translate R code, data and graphics to JavaScript for us.plotly.js for python and MATLAB.Server side:
You will at times be asked to read Chapters from Cleveland’s “Visualizing Data” and Healy’s “Data Visualization: a practical introduction”. You will be asked to present several times throughout the semester and we will devote some time in class for in-depth feedback.
An example of an interactive (and animated) plot is shown in the following:
Given the data, all it took to generate the animated plot is the following piece of code:
gg <-
ggplot(gapminder, aes(gdpPercap, lifeExp, color = continent)) +
geom_point(aes(size = pop, frame = year, ids = country)) +
scale_x_log10() +
theme(legend.title = element_blank())
ggplotly(gg)
But is it worth anything? It all depends on the story you tell.
There are ALWAYS A LOT of assumptions behind how any data generated, and what our visualizations actually represent.
Source - Encycopeadia Britannica
Note: the gapminder website does not mention its source for this measure.
Note: the gapminder website mentions several sources for GDP per Capita estimates, but does not explain how they were spliced together.
See the following for
Compare:
To:
Source: Healy, Chapter 1
Source: Healy, Chapter 1
Some words from a visualiztion researcher:
https://rstudio.com/resources/rstudioconf-2020/effective-visualizations/
(8:15-17:28)
The University of Iowa’s Covid by state / county dashboard, which presents past and predicted figures for Covid-19 figures in the US:
The engines used in the UIowa dashboard are:
shiny (core of work done on server)leaflet (free open-source JavaScript libraries for interactive maps for the web)
leaflet.js (in the browser), the R package leaflet interfaces R and JavaScript.mapbox.com (not open source, only free for limited use)plotly:
plotly.js (in the browser), the R package plotly interfaces R and JavaScriptQuestions?